import React from 'react';
import {createStackNavigator} from '@react-navigation/stack';
import {NavigationContainer} from '@react-navigation/native';
import NavigationConfig from '../config/NavigationConfig';

import NavigationUtil from '../utils/NavigationUtil';

//创建初始化导航器
const Stack = createStackNavigator();
function CreateInitNavigation() {
  return (
    <Stack.Navigator
      initialRouteName="HomePage"
      headerMode="none"
      screenOptions={{}}>
      <Stack.Screen name={'HomePage'} component={CreateMainNavigation} />
    </Stack.Navigator>
  );
}

//创建主控制器(普通)
function CreateMainNavigation() {
  return NavigationUtil.CreateMainNavigation(NavigationConfig.MainNavigation);
}

//创建主控制器(带颜色变化)
function CreateMaterialNavigation() {
  return NavigationUtil.CreateMaterialNavigation(
    NavigationConfig.MainNavigation,
  );
}

export default function AppNavigation() {
  return (
    <NavigationContainer>
      <CreateInitNavigation />
    </NavigationContainer>
  );
}
